package com.csmht.tododemo.controller.admin;

import com.csmht.tododemo.annotation.RoleIntercept;
import com.csmht.tododemo.pojo.dto.BanDTO;
import com.csmht.tododemo.pojo.dto.CommentPageDTO;
import com.csmht.tododemo.pojo.dto.ReportDTO;
import com.csmht.tododemo.pojo.entity.Todo;
import com.csmht.tododemo.pojo.enumeration.RoleEnum;
import com.csmht.tododemo.pojo.vo.ReportVO;
import com.csmht.tododemo.pojo.vo.ToDoVO;
import com.csmht.tododemo.result.PageResult;
import com.csmht.tododemo.result.Result;
import com.csmht.tododemo.service.ReportService;
import jakarta.annotation.Resource;
import lombok.Generated;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController("adminReportController")
@RequestMapping("/admin/report")
@Slf4j
@RoleIntercept(roles = {RoleEnum.ADMIN})
public class ReportController {

    @Resource
    private ReportService reportService;

    @PutMapping("/ban")
    public Result<Object> ban(@RequestBody BanDTO banDTO) {

        reportService.ban(banDTO);

        return Result.success();
    }

    @GetMapping
    private PageResult<ReportVO> getReportTodo(){
        List<ReportVO> ans =  reportService.getReportTodo();

        return PageResult.success(ans);
    }

}
